home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / mem / staticgetsize.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  373 b   |  24 lines

  1.  
  2. #include "tek/mem.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TUINT TStaticGetSize(TMEMHEAD *head, TAPTR mem)
  10. **
  11. **    get size of a static allocation.
  12. **
  13. */
  14.  
  15. TUINT TStaticGetSize(TMEMHEAD *head, TAPTR mem)
  16. {
  17.     if (mem && head)
  18.     {
  19.         TMEMNODE *p = (TMEMNODE *) ((TUINT8 *) mem - head->memnodesize);
  20.         return p->size - p->free;
  21.     }
  22.     return 0;
  23. }
  24.